﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using EDiamondModel;

/// <summary>
/// Summary description for DichVuVanChuyen
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class DichVuVanChuyen : System.Web.Services.WebService {

    public DichVuVanChuyen () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public int LayGiaVanChuyen(float TrongLuong, int ThanhPhoDi, int ThanhPhoDen)
    {
        EDiamondEntities1 d = new EDiamondEntities1();
        var gia = d.ThanhPhoes.Single(x => x.Id == ThanhPhoDen).DonGia;
        return gia.Value;
    }
    [WebMethod]
    public List<Nuoc> LayDanhSachNuoc()
    {
        EDiamondEntities1 d = new EDiamondEntities1();

        return d.Nuocs.ToList<Nuoc>();
    }
    [WebMethod]
    public List<ThanhPho> LayDanhSachThanhPho()
    {
        EDiamondEntities1 d = new EDiamondEntities1();
        return d.ThanhPhoes.ToList<ThanhPho>();
    }
}
